$(function () {
  var appKey = "k51hidwqkn8zb";
  var token = "ssZQE9d3IXQnVc82yrm/18iIr/ZBwXx/Z4mykaq8NWOWIEx5giaJhxrJc8LCOHApDVhUNToyMwrBlddiNimmkQ==";
  RCS.init({
    appKey: appKey,
    token: token,
    target: document.getElementById('rcs-app'),
    showConversitionList: true,
    templates: {
      button: ['<div class="rongcloud-consult rongcloud-im-consult">',
        '   <button onclick="RCS.showCommon()"><span class="rongcloud-im-icon">进入 IM</span></button>',
        '</div>',
        '<div class="customer-service" style="display: none;"></div>'
      ].join(''),
      // button: "templates/button.html",
      // chat: "templates/chat.html",
      // closebefore: 'templates/closebefore.html',
      // conversation: 'templates/conversation.html',
      // endconversation: 'templates/endconversation.html',
      // evaluate: 'templates/evaluate.html',
      // imageView: 'templates/imageView.html',
      // leaveword: 'templates/leaveword.html',
      // main: 'templates/main.html',
      // message: 'templates/message.html',
      // messageTemplate: 'templates/messageTemplate.html',
      // userInfo: 'templates/userInfo.html', 
    },
    extraInfo: {
      // 当前登陆用户信息
      userInfo: {
        name: "游客",
        grade: "VIP"
      },
      // 产品信息
      requestInfo: {
        productId: "123",
        referrer: "10001",
        define: "" // 自定义信息
      }
    }
  });
})